package com.play.ballen.home.ui

import android.content.Context
import android.content.Intent
import com.play.ballen.R
import com.play.ballen.databinding.ActivityDragImgBinding
import com.play.ballen.home.adapter.ScanAdapter
import com.play.ballen.home.vm.PLPFragmentVM
import com.yuven.baselib.component.BaseMVVMActivity

class DragImgActivity : BaseMVVMActivity<PLPFragmentVM, ActivityDragImgBinding>(){

    private var scanAdapter: ScanAdapter? = null
    var data1: String? = null
    val pic = mutableListOf<String>()
    companion object {
        @JvmStatic
        fun start(context: Context, data1: String) {
            val starter = Intent(context, DragImgActivity::class.java)
            starter.putExtra("key_data1", data1)
            context.startActivity(starter)
        }
    }


    override fun layoutId(): Int {
        return R.layout.activity_drag_img
    }

    override fun viewModelClass(): Class<PLPFragmentVM> {
        return PLPFragmentVM::class.java
    }

    override fun initView() {
        scanAdapter = ScanAdapter(this,pic)
        dataBinding.dragBanner.setAdapter(scanAdapter)
        dataBinding.dragBanner.isAutoLoop(false)
        dataBinding.ivClose.setOnClickListener{
            finish()
        }
    }

    override fun initData() {
        data1 = intent.getStringExtra("key_data1").toString()
        pic.add(data1!!)

    }

    override fun initIntent(intent: Intent?) {

    }
}